<?php
    $cost = $_POST['cost'];

    //Removing the white spaces.
    $cost = trim($cost);

    //Change comas to dots so that the string can be converted to float even if the user use coma as separator.
    $cost = str_replace(',', '.', $cost);
?>
